import request from '@/utils/request'
//商品单个

export function getGoods(id) {
  return request({
    url: `/goods/${id}`,
    method: 'get',
  })
}

//商品信息
export function getgood(goodName,currentPage,pagesizes) {
  return request({
    url: '/goods',
    method: 'get',
    params: { goodName,currentPage,pagesizes }
  })
}

//商品删除
export function deletegoods(goodId) {
  return request({
    url: `/goods/${goodId}`,
    method: 'delete',
  })
}

//更新
export  function Updategoods(commonGoods){
  return request({
    url: `/goods/update`,
    method: 'put',
    data:commonGoods
  })
}

//新增
export function addGood(data) {
  return request({
    url: '/goods/insert',
    method: 'post',
    data,
  })

}


